package great.easychat.help.util;

import java.util.Random;

public class RandomUtil {

    // 生成四位随机邀请码
    public static String getCode() {
        String str="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
        StringBuilder sb=new StringBuilder(4);
        for(int i=0;i<4;i++)
        {
            char ch=str.charAt(new Random().nextInt(str.length()));
            sb.append(ch);
        }
        String code = sb.toString();
        DebugLog.d("随机码--> "+code);
        return code;
    }

}
